package com.zz.inventory.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zz.inventory.mapper.StudentExamRecordsMapper;
import com.zz.inventory.domain.StudentExamRecords;
import com.zz.inventory.service.IStudentExamRecordsService;

/**
 * 学生考试记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-03
 */
@Service
public class StudentExamRecordsServiceImpl implements IStudentExamRecordsService 
{
    @Autowired
    private StudentExamRecordsMapper studentExamRecordsMapper;

    /**
     * 查询学生考试记录
     * 
     * @param recordId 学生考试记录主键
     * @return 学生考试记录
     */
    @Override
    public StudentExamRecords selectStudentExamRecordsByRecordId(Long recordId)
    {
        return studentExamRecordsMapper.selectStudentExamRecordsByRecordId(recordId);
    }

    /**
     * 查询学生考试记录列表
     * 
     * @param studentExamRecords 学生考试记录
     * @return 学生考试记录
     */
    @Override
    public List<StudentExamRecords> selectStudentExamRecordsList(StudentExamRecords studentExamRecords)
    {
        return studentExamRecordsMapper.selectStudentExamRecordsList(studentExamRecords);
    }

    /**
     * 新增学生考试记录
     * 
     * @param studentExamRecords 学生考试记录
     * @return 结果
     */
    @Override
    public int insertStudentExamRecords(StudentExamRecords studentExamRecords)
    {
        return studentExamRecordsMapper.insertStudentExamRecords(studentExamRecords);
    }

    /**
     * 修改学生考试记录
     * 
     * @param studentExamRecords 学生考试记录
     * @return 结果
     */
    @Override
    public int updateStudentExamRecords(StudentExamRecords studentExamRecords)
    {
        return studentExamRecordsMapper.updateStudentExamRecords(studentExamRecords);
    }

    /**
     * 批量删除学生考试记录
     * 
     * @param recordIds 需要删除的学生考试记录主键
     * @return 结果
     */
    @Override
    public int deleteStudentExamRecordsByRecordIds(Long[] recordIds)
    {
        return studentExamRecordsMapper.deleteStudentExamRecordsByRecordIds(recordIds);
    }

    /**
     * 删除学生考试记录信息
     * 
     * @param recordId 学生考试记录主键
     * @return 结果
     */
    @Override
    public int deleteStudentExamRecordsByRecordId(Long recordId)
    {
        return studentExamRecordsMapper.deleteStudentExamRecordsByRecordId(recordId);
    }

    @Override
    public List<StudentExamRecords> getByStudentId(Long studentId) {
        //直接查询
        return studentExamRecordsMapper.selectByStudentId(studentId);
    }

    @Override
    public int deleteByStudentId(Long studentId) {
        return studentExamRecordsMapper.deleteByStudentId(studentId);
    }
}
